/** ==================================================================================== **/
/** 		Definizione dei Model per la gestione dei service, controller, ecc..  	 	 **/
/** 		definiti nella cartella ../application/...								 **/
/** ==================================================================================== **/

/** 
 * Model dove salvare i dati di configurazione del geocoding.
 * 
 *  - "categorie": String[] - Uno o più codici layer per cui filtrare la ricerca indirizzo
 *  - "priorityPosition": Array[lon, lat] - Cerca, con priorità a una posizione geo
 */
BootApplication.factory("GeocoderOptions", function() {
	
	/** 
	 * Define the constructor function. 
	 */
    function GeocoderOptions(categorie, priorityPosition) {
    	this.categorie = categorie;
    	this.priorityPosition = priorityPosition;
    }
    
    /**
     * Define the "instance" methods using the prototype and standard prototypal inheritance.
     */
    GeocoderOptions.prototype = {
    	getCategorie: function() { return( this.categorie ); },
    	setCategorie: function(categorie) { this.categorie = categorie; },
    	
    	getPriorityPosition: function() { return( this.priorityPosition ); },
    	setPriorityPosition: function(priorityPosition) { this.priorityPosition = priorityPosition; }
    };
    
    /**
	 * Return the constructor function
	 */
    return GeocoderOptions;
});


/** 
 * Model dove salvare i dati ritornati dal geocoding.
 * 
 *  - "success": 
 *  - "desc": 
 *  - "lon": 
 *  - "lat": 
 *  - "type": 
 *  - "city": 
 *  - "housenumber": 
 *  - "codiceZona":
 *  - "categoria":  
 *  - "extraData": 
 *  - "stradaId": 
 *  - "regioneId": 
 *  - "comuneId":
 *  - "provinciaId":
 *  - "icona":
 */
BootApplication.factory("GeocoderInfo", function() {
	
	/** 
	 * Define the constructor function. 
	 */
    function GeocoderInfo() {
    	this.success = null;
    	this.desc = null;
    	this.lon = null;
    	this.lat = null;
    	this.type = null;
    	this.city = null;
    	this.housenumber = null;
    	this.codiceZona = null;
    	this.categoria = null;
    	this.extraData = null;
    	this.stradaId = null;
    	this.regioneId = null;
    	this.comuneId = null;
    	this.provinciaId = null;
      	this.icona = null;
    }
    
    function GeocoderInfo(success, desc, lon, lat, type, city, housenumber, codiceZona, categoria, extraData, stradaId, regioneId, comuneId, provinciaId, icona) {
    	this.success = success;
    	this.desc = desc;
    	this.lon = lon;
    	this.lat = lat;
    	this.type = type;
    	this.city = city;
    	this.housenumber = housenumber;
    	this.codiceZona = codiceZona;
    	this.categoria = categoria;
    	this.extraData = extraData;
    	this.stradaId = stradaId;
    	this.regioneId = regioneId;
    	this.provinciaId = provinciaId;
    	this.comuneId = comuneId;
    	this.icona = icona;
    }
    
    /**
     * Define the "instance" methods using the prototype and standard prototypal inheritance.
     */
    GeocoderInfo.prototype = {
    	getSuccess: function() { return( this.success ); },
    	setSuccess: function(success) { this.success = success; },
    	
    	getDesc: function() { return( this.desc ); },
    	setDesc: function(desc) { this.desc = desc; },
    	
    	getLon: function() { return( this.lon ); },
    	setLon: function(lon) { this.lon = lon; },
    	
    	getLat: function() { return( this.lat ); },
    	setLat: function(lon) { this.lat = lat; },
    	
    	getType: function() { return( this.type ); },
    	setType: function(type) { this.type = type; },
    	
    	getCity: function() { return( this.city ); },
    	setCity: function(city) { this.city = city; },
    	
    	getHousenumber: function() { return( this.housenumber ); },
    	setHousenumber: function(housenumber) { this.housenumber = housenumber; },

    	getCodiceZona: function() { return( this.codiceZona ); },
    	setCodiceZona: function(codiceZona) { this.codiceZona = codiceZona; },
    	
    	getCategoria: function() { return( this.categoria ); },
    	setCategoria: function(categoria) { this.categoria = categoria; },
    	
    	getExtraData: function() { return( this.extraData ); },
    	setExtraData: function(extraData) { this.extraData = extraData; },
    	
    	getStradaId: function() { return( this.stradaId ); },
    	setStradaId: function(stradaId) { this.stradaId = stradaId; },
    	
    	getRegioneId: function() { return( this.regioneId ); },
    	setRegioneId: function(regioneId) { this.regioneId = regioneId; },
    	
    	getProvinciaId: function() { return( this.provinciaId ); },
    	setProvinciaId: function(provinciaId) { this.provinciaId = provinciaId; },
    	
    	getComuneId: function() { return( this.comuneId ); },
    	setComuneId: function(comuneId) { this.comuneId = comuneId; },
    	
    	getIcona: function() { return( this.icona ); },
    	setIcona: function(icona) { this.icona = icona; }
    };
    
    /**
	 * Return the constructor function
	 */
    return GeocoderInfo;
});